package com.yq.homework.day20;

/**
 * @author 3307235355@qq.com
 * @since 2022/06/20 19:30
 * getClass()方法练习
 * 定义两个类，然后分别创建对象，调用getClass方法
 * 用“==”号比较它们的运行时Class对象是否相等，并说明原因
 * 理解运行时类对象、类加载、类的对象的区别
 */
public class Demo01 {
    public static void main(String[] args) {
        A a = new A();
        A a1 = new A();
        B b = new B();
        Class ac = a.getClass();
        Class ac1 = a1.getClass();
        Class bc = b.getClass();
        System.out.println(ac);
        System.out.println(bc);
        System.out.println(ac == bc);
        System.out.println(ac == ac1);
    }
}

class A{

}
class B{

}
